import json

class FlowModel:
	def __init__(self,flowId,flowName,nodeList):
		'''
		流程ID
		'''
		self.flowId = flowId
		self.flowName = flowName
		self.nodeList = nodeList

	def getNodeModel(self,nodeId):
		List = []
		for i in range(len(self.nodeList)):
			if (self.nodeList[i]['nodeType'] == nodeId):
				List.append(self.nodeList[i])
		print(List)
		return List

	def getStartModel(self):
		return self.getNodeModel('START')
	def getTaskModel(self):
		return self.getNodeModel('TASK')
	def getEndModel(self):
		return self.getNodeModel('END')


with open('content.json', 'r',encoding='utf-8') as jsonfile:
	json_string = json.load(jsonfile)

flowmodel = FlowModel(json_string['Id'],json_string['flowName'],json_string['nodeList'])

startmodel = flowmodel.getStartModel()
taskmodel = flowmodel.getTaskModel()
endmodel = flowmodel.getEndModel()